Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support running tests in forked repository workflow #85

Merged
merged 1 commit into from
Jun 22, 2021

Conversation

nab-gha
Copy link
Contributor

@nab-gha nab-gha commented Jun 22, 2021

Changes the GITHUB_TOKEN environmental variable to GITPROVIDER_BOT_TOKEN
because github secrets cannot start with GITHUB_

Add an option to cleanup all test repos, the integration tests sometimes
fail to cleanup.

Signed-off-by: Paul Carlton [email protected]

Description

Changes the GITHUB_TOKEN environmental variable to GITPROVIDER_BOT_TOKEN
because github secrets cannot start with GITHUB_

Add an option to cleanup all test repos, the integration tests sometimes
fail to cleanup.

Test results

go mod tidy
go fmt ./...
go vet ./...
go test -race -coverprofile=coverage.txt -covermode=atomic ./...
? github.com/fluxcd/go-git-providers/bitbucket [no test files]
ok github.com/fluxcd/go-git-providers/github 13.859s coverage: 50.8% of statements

ok github.com/fluxcd/go-git-providers/gitlab 40.272s coverage: 73.9% of statements
ok github.com/fluxcd/go-git-providers/gitprovider 0.141s coverage: 94.5% of statements
? github.com/fluxcd/go-git-providers/gitprovider/cache [no test files]
? github.com/fluxcd/go-git-providers/gitprovider/testutils [no test files]
ok github.com/fluxcd/go-git-providers/validation 0.058s coverage: 100.0% of statements

README.md Outdated
@@ -178,8 +178,10 @@ If you need to run `make test` for your fork/branch you may need to supply the f
- GIT_PROVIDER_USER : This should be the same username for both GitHub and GitLab.
- GITLAB_TEST_TEAM_NAME : An existing GitLab group.
- GITLAB_TEST_SUBGROUP : An existing GitLab subgroup of the GIT_PROVIDER_ORGANIZATION top-level group.
- GITHUB_TOKEN : A GitHub token with `repo`, `admin:org` and `delete_repo` permissions.
- GITH_TOKEN : A GitHub token with `repo`, `admin:org` and `delete_repo` permissions.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, using GITPROVIDER_BOT_TOKEN because when running in GitHub workflow secrets starting with GITHUB_ are not allowed.

@nab-gha nab-gha force-pushed the tests branch 3 times, most recently from 0e92c40 to 6cb112c Compare June 22, 2021 10:38
Changes the GITHUB_TOKEN environmental variable to GITPROVIDER_BOT_TOKEN
because github secrets cannot start with GITHUB_

Add an option to cleanup all test repos, the integration tests sometimes
fail to cleanup.

Signed-off-by: Paul Carlton <[email protected]>
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks @paulcarlton-ww

@nab-gha
Copy link
Contributor Author

nab-gha commented Jun 22, 2021

Thanks, can someone merge this please?

@stefanprodan stefanprodan merged commit 3e09c9c into fluxcd:main Jun 22, 2021
@nab-gha nab-gha deleted the tests branch June 22, 2021 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants